﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuanTriImageChiTiet.aspx.cs"
    Inherits="QuangMobile.Admin.QuanTriImageChiTiet" MasterPageFile="~/Admin/AdminSite.Master"
    MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Quản trị Chi tiết phóng sự ảnh</p>
    </div>
    <div class="NoiDung">
        <div id="ThemMoiAnh" runat="server">
            <table>
                <tr>
                    <td>
                        Ảnh hiển thị
                    </td>
                    <td>
                        <asp:FileUpload ID="ImgUpload" runat="server" Mul />
                    </td>
                </tr>
                <tr>
                    <td>
                        Mô tả ảnh
                    </td>
                    <td>
                        <asp:TextBox ID="txtMoTaAnh" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <asp:Button ID="btnThemMoi" runat="server" Text="Thêm mới ảnh Bài viết" CssClass="cmdBtn"
            OnClick="btnThemMoi_Click" />
        <div class="Galery">
            <asp:ListView ID="lstImage" runat="server" DataKeyNames="ID" OnItemCanceling="lstImage_ItemCanceling"
                OnItemCommand="lstImage_ItemCommand" OnItemDeleting="lstImage_ItemDeleting" OnItemEditing="lstImage_ItemEditing">
                <LayoutTemplate>
                    <ul class="ImageList">
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <li>
                        <div style="width: 250px; height: auto; margin-right: 15px; padding-right: 15px;">
                            <center>
                                <img src='<%# "../"+Eval("AttachFile") %>' style="max-height: 150px; max-width: 220px" />
                                <p>
                                    <%# Eval("TieuDe")%></p>
                                <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../images/edit.gif" ToolTip="Sửa"
                                    CommandArgument='<%# Eval("ID")%>' CommandName="Edit"></asp:ImageButton><asp:ImageButton
                                        ID="imgDelete" runat="server" ImageUrl="../images/delete.png" ToolTip="Sửa" CommandArgument='<%# Eval("ID")%>'
                                        CommandName="<%# QuangMobile.MyConst.Action.Delete %>" OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')">
                                    </asp:ImageButton>
                            </center>
                        </div>
                    </li>
                </ItemTemplate>
                <EditItemTemplate>
                    <li>
                        <div style="height: 300px;">
                            <img src='<%# "../"+Eval("AttachFile") %>' width="220px" /><br />
                            <asp:FileUpload ID="FileUpload1" runat="server" />
                            <p style="font-family: Tahoma">
                                <b>Tiêu đề : </b>
                                <asp:TextBox ID="txtTieuDe" runat="server" Text='<%# Eval("TieuDe") %>'></asp:TextBox>
                            </p>
                            <p style="text-align: center">
                                <asp:ImageButton ID="imgUpdate" runat="server" ImageUrl="../images/approval.png"
                                    ToolTip="Cập nhật" CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Approve %>">
                                </asp:ImageButton>
                                <asp:ImageButton ID="imgCancel" runat="server" CommandName="Cancel" ImageUrl="../images/cancel.png"
                                    CommandArgument='<%# Eval("ID") %>' />
                        </div>
                    </li>
                </EditItemTemplate>
            </asp:ListView>
        </div>
    </div>
</asp:Content>
